package cn.huijielong.common.props;

import java.io.InputStream;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import cn.huijielong.common.wxpay.WXPayDomain;
import cn.huijielong.common.wxpay.sdk.IWXPayDomain;
import cn.huijielong.common.wxpay.sdk.WXPayConfig;

@ConfigurationProperties(prefix = "props")
@Component
public class PropsConfig {
	private Jwt jwt;
	private Wx wx;
	private Wxpay wxpay;

	public Jwt getJwt() {
		return jwt;
	}

	public void setJwt(Jwt jwt) {
		this.jwt = jwt;
	}

	public Wx getWx() {
		return wx;
	}

	public void setWx(Wx wx) {
		this.wx = wx;
	}

	public Wxpay getWxpay() {
		return wxpay;
	}

	public void setWxpay(Wxpay wxpay) {
		this.wxpay = wxpay;
	}

	public static class Jwt {
		private String secret;
		private long expire;
		private String header;
		public String getSecret() {
			return secret;
		}
		public void setSecret(String secret) {
			this.secret = secret;
		}
		public long getExpire() {
			return expire;
		}
		public void setExpire(long expire) {
			this.expire = expire;
		}
		public String getHeader() {
			return header;
		}
		public void setHeader(String header) {
			this.header = header;
		}
		
	}

	public static class Wx {
		/**
		 * 小程序AppId
		 */
		private String appId;
		/**
		 * 小程序AppSecret
		 */
	    private String appSecret;
	    /**
	     * 模板消息URL
	     */
	    private String sendMsgUrl;
		public String getAppId() {
			return appId;
		}
		public void setAppId(String appId) {
			this.appId = appId;
		}
		public String getAppSecret() {
			return appSecret;
		}
		public void setAppSecret(String appSecret) {
			this.appSecret = appSecret;
		}
		public String getSendMsgUrl() {
			return sendMsgUrl;
		}
		public void setSendMsgUrl(String sendMsgUrl) {
			this.sendMsgUrl = sendMsgUrl;
		}
	    
	}

	public static class Wxpay  extends WXPayConfig{
		private String appId;
		private String mchId;
		private String key;
		private String notifyUrl;
		public String getAppId() {
			return appId;
		}
		public void setAppId(String appId) {
			this.appId = appId;
		}
		public String getMchId() {
			return mchId;
		}
		public void setMchId(String mchId) {
			this.mchId = mchId;
		}
		public String getKey() {
			return key;
		}
		public void setKey(String key) {
			this.key = key;
		}
		public String getNotifyUrl() {
			return notifyUrl;
		}
		public void setNotifyUrl(String notifyUrl) {
			this.notifyUrl = notifyUrl;
		}
		@Override
		public InputStream getCertStream() {
			return null;
		}
		@Override
		public IWXPayDomain getWXPayDomain() {
			return new WXPayDomain();
		}
	}
}
